package com.cskaoyan.controller;


import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.service.CatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/wx/catalog")
public class WxCatalogController {


    @Autowired
    CatalogService catalogService;

    @RequestMapping("/index")
    public BaseRespVo indexCatalogs() {
        BaseRespVo baseRespVo = catalogService.getIndex();
        return baseRespVo;
    }
    @RequestMapping("/current")
    public BaseRespVo as(Integer id){
        Map<String, Object> current = catalogService.getCurrent(id);
        return BaseRespVo.ok(current);
    }
}
